package com.richpencil.modules.weixin.domain;

import java.util.Map;

public class RedPackObject {

    public boolean isSuccess() {
        return success;
    }
    public void setSuccess(boolean success) {
        this.success = success;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public String getErrorcode() {
        return errorcode;
    }
    public void setErrorcode(String errorcode) {
        this.errorcode = errorcode;
    }
    public String getErrorcodedes() {
        return errorcodedes;
    }
    public void setErrorcodedes(String errorcodedes) {
        this.errorcodedes = errorcodedes;
    }
    public boolean success=false;
    public String message="";
    public String errorcode="";
    public String errorcodedes="";
    public String getBillno() {
        return billno;
    }
    public void setBillno(String billno) {
        this.billno = billno;
    }
    public String billno="";


    public RedPackObject()
    {

    }

    public RedPackObject(Map<String,String> map)
    {
        String return_code = map.get("result_code");
        if("SUCCESS".equalsIgnoreCase(return_code)==true) {
            this.success=true;
        } else {
            this.success=false;
        }
        // 返回信息
        this.message = map.get("return_msg");
        // 错误代码
        this.errorcode = map.get("err_code");
        // 错误代码描述
        this.errorcodedes = map.get("err_code_des");
    }


    @Override
    public String toString() {

        return "success"+this.success +"message :" +this.message +" billno:"+this.billno+
                "errorcode" + this.errorcode +"errorcodedes:" + this.errorcodedes;
    }
}
